package controllers;

import business.LoginBusiness;
import models.LoginTO;

public class LoginApplication extends Application{
	
	public static void validarLogin(String name, String password){
		LoginTO login = new LoginTO();
		login.name = name;
		login.password = password;
		
		LoginBusiness business = new LoginBusiness();
		business.validarLogin(login);
		if(login.validLogin){
			login.code=CODE_OK_STATUS;
			login.description=DESCRIPTION_OK_STATUS;
		}else {
			login.code=CODE_NOK_STATUS;
			login.description="INVALID LOGIN";
		}
		renderJSON(login);
	}
}
